package com.foo.designpattern.decorator;

import junit.framework.TestCase;

/**
 * com.foo.designpattern.decorator
 * Created with IntelliJ IDEA.
 * Created by jiang on 2016-05-18 14:03.
 *
 * @Description 测试类：装饰模式(Decorator)
 */

public class DecoratorTestCase extends TestCase {

    public void testDecorator() {
        System.out.println("= = = = ↓↓↓装饰模式，测试开始↓↓↓ = = = =");

        Component component = new ConcreteComponent();

        Component concreteDecoratorA = new ConcreteDecoratorA(component);
        Component concreteDecoratorB = new ConcreteDecoratorB(
                concreteDecoratorA);

        concreteDecoratorB.sampleOperation();

        System.out.println("= = = = ↑↑↑装饰模式，测试结束↑↑↑ = = = =");
    }
}
